home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Ebooks / Thinking in C++ V2 / C09 / Cpptime.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-25  |  548 b   |  23 lines

  1. //: C09:Cpptime.cpp
  2. // From Thinking in C++, 2nd Edition
  3. // Available at http://www.BruceEckel.com
  4. // (c) Bruce Eckel 1999
  5. // Copyright notice in Copyright.txt
  6. // Testing a simple time class
  7. #include "Cpptime.h"
  8. #include <iostream>
  9. using namespace std;
  10.  
  11. int main() {
  12.   Time start;
  13.   for(int i = 1; i < 1000; i++) {
  14.     cout << i << ' ';
  15.     if(i%10 == 0) cout << endl;
  16.   }
  17.   Time end;
  18.   cout << endl;
  19.   cout << "start = " << start.ascii();
  20.   cout << "end = " << end.ascii();
  21.   cout << "delta = " << end.delta(&start);
  22. } ///:~
  23.